/**
 * Created by HSH on 2016/3/12.
 */
define(function () {
    'use strict';
    return {
        /**
         * Users log in and get permission
         * @param authenticationInfo: User account
         */
        UserLoginOperation: function (authenticationInfo) {
            var dfd = $.Deferred();
            ePart.app.iptv.userLogin({
                userType: 1,
                userName: authenticationInfo.userName,
                passWord: authenticationInfo.passWord
            }).success(function (data) {
                dfd.resolve(data);
                ePart.log(data);
                ePart.session.put('isLogin', true);
            }).error(dfd.reject);
            return dfd;
        },
        authenticate: function (authenticationInfo) {

        },
        guestLogin: function () {
            ePart.app.iptv.userLogin({
                userType: 3
            }).success(function () {
                ePart.session.put('userType', 'norMalAsGuest');
            });
        }
    }
});
